﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Lapv.Master" AutoEventWireup="true"
    CodeBehind="RoleAdd.aspx.cs" Inherits="Lapv.Account.RoleAdd" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="header" runat="server">
    <%--menu tab  --%>
    <div class="tabnav">
        <ul>
             <li><a href="<%= domain%>Account/AccMN.aspx" class="list_t">D/S Tài khoản</a></li>
            <li><a href="<%= domain%>Account/AccAdd.aspx" class="add_t">Thêm Tài khoản</a></li>
            <li  class="active"><a href="<%= domain%>Account/RoleAdd.aspx" class="list_t">Thêm role</a></li>
            <li ><a href="<%= domain%>Account/PermissionAdd.aspx" class="add_t">Thêm Permission</a></li>  
        </ul>
        <div class="clr">
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="content" runat="server">
    <div class="form form1">
        <div >
            <span>Mã quyền</span>
            <asp:TextBox ID="txtID" runat="server"></asp:TextBox>
        </div>
        <div>
            <span>Tên quyền</span>
            <div>
                <asp:TextBox ID="txtRole" runat="server"></asp:TextBox>
            </div>
        </div>
        <div>
            <span>Tên quyền</span>
            <div>
                <asp:CheckBoxList ID="chkPermission" runat="server" />
            </div>
        </div>
        <div>
            <span></span>
            <div>
                <asp:Button ID="bt_luu" runat="server" Text="Lưu" OnClick="btnEdit_Click" />
                <input type="button" value="Hủy" />
            </div>
        </div>
    </div>
    <%--form2 list - grid -table--%>
    <div class="form form2">
        <asp:DataGrid ID="dtgrid" runat="server" CssClass="table1" AutoGenerateColumns="false" OnItemCommand="Update_ItemCommand">
          <Columns>
                <asp:TemplateColumn HeaderText="Mã quyền" ItemStyle-Width="60" >
                    <itemtemplate>
                        <asp:Label runat="server" ID="lb_id" Text='<%# Eval("id") %>' />
                    </itemtemplate>
                </asp:TemplateColumn>
                <asp:TemplateColumn HeaderText="Tên quyền" ItemStyle-Width="300">
                    <itemtemplate>
                        <%# Eval("name")%>
                     </itemtemplate>
                </asp:TemplateColumn>
                <asp:TemplateColumn HeaderText="Truy cập" ItemStyle-Width=" ">
                    <itemtemplate>
                    <%# Eval("permissions")%>
                </itemtemplate>
                </asp:TemplateColumn>
                <asp:TemplateColumn HeaderText="Sửa" ItemStyle-Width="30">
                    <itemtemplate>
                     <asp:LinkButton runat="server" ID="lbt_edit" CommandName="Edit" CommandArgument='<%# Eval("id") %>'
                        Text="Sửa"><img src="../styles/imgs/edit.gif " /></asp:LinkButton>
                    </itemtemplate>
                </asp:TemplateColumn>
                <asp:TemplateColumn HeaderText="Xóa" ItemStyle-Width="30">
                    <itemtemplate>
                    <asp:LinkButton runat="server" ID="lbtn_delete" CommandName="Delete" OnClientClick="return confirm('Xóa vĩnh viễn?')"
                        CommandArgument='<%# Eval("id") %>' Text="Xóa">
                        <img src="../styles/imgs/delete.gif " /></asp:LinkButton>
                </itemtemplate>
                </asp:TemplateColumn>
            </Columns>
                 
        </asp:DataGrid>
    </div>
</asp:Content>
